package com.niit.agricstore.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.niit.agricstore.entity.Logistics;
import com.niit.agricstore.entity.Picture;
import com.niit.agricstore.mapper.LogisticMapper;
import com.niit.agricstore.mapper.PictureMapper;
import com.niit.agricstore.service.LogisticsService;
import com.niit.agricstore.service.PictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;
@Service
public class PictureServiceImpl extends ServiceImpl<PictureMapper, Picture> implements PictureService {
    @Autowired
    PictureMapper pictureMapper;
    @Override
    public List<Picture> getImagesByProductId(Long productId) {
        return null;
//        return pictureMapper.selectList();
    }

    @Override
    public Picture getImageById(Long id) {
        return null;
    }
    @Override
    public Picture getMainImageById(Long id) {
        QueryWrapper queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("pic_id",id);
        return pictureMapper.selectOne(queryWrapper);
    }
    @Override
    public Picture uploadImage(MultipartFile file, Long productId) throws IOException {
        return null;
    }

    @Override
    public void deleteImage(Long id) {

    }
}
